package pkg.chemdrm;

import org.anddev.andengine.engine.camera.BoundCamera;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.handler.timer.ITimerCallback;
import org.anddev.andengine.engine.handler.timer.TimerHandler;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.Scene.IOnSceneTouchListener;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.entity.text.Text;
import org.anddev.andengine.input.touch.TouchEvent;
import org.anddev.andengine.input.touch.controller.ITouchController.ITouchEventCallback;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.util.HorizontalAlign;

import android.content.Context;

public class AttackScene
extends ChemScene
{

	// declare text
	private final Text mReturnText;
	private final Text mBodyText1;
	private final Text mBodyText2;
	private final Text mBodyText3;
	private final Text mBodyText4;
	private final Text mBodyText5;
	
	// declare strings within text
	private final String body1;
	private final String body2;
	private final String body3;
	private final String body4;
	private final String body5;

	
	public AttackScene(final Context pContext, final SceneHandler pSceneHandler, final ResourceHandler pResourceHandler, final BoundCamera pCamera)
	{
		
		super(pContext, pSceneHandler, pResourceHandler, pCamera);
		buildScene();
		
		mReturnText = new Text(0, 0, mResourceHandler.getFont(), "Back", HorizontalAlign.LEFT)
		{
			@Override
			public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY)
			{
				// when we touch the text to return to the Help screen
				mSceneHandler.setScene("Help");
				return true;
			}
		};
		
		body1 = 	"In order to attack an enemy,";
		body2 =		"choose a chemical from the";
		body3 =		"inventory. Drag your finger";
		body4 =		"across the character in the";
		body5 =		"direction you want to attack.";
		
		mBodyText1 = new Text(0, 50, mResourceHandler.getFont(), body1, HorizontalAlign.LEFT);
		mBodyText2 = new Text(0, 80, mResourceHandler.getFont(), body2, HorizontalAlign.LEFT);
		mBodyText3 = new Text(0, 110, mResourceHandler.getFont(), body3, HorizontalAlign.LEFT);
		mBodyText4 = new Text(0, 140, mResourceHandler.getFont(), body4, HorizontalAlign.LEFT);
		mBodyText5 = new Text(0, 170, mResourceHandler.getFont(), body5, HorizontalAlign.LEFT);
		

		attachChild(mReturnText);
		attachChild(mBodyText1);
		attachChild(mBodyText2);
		attachChild(mBodyText3);
		attachChild(mBodyText4);
		attachChild(mBodyText5);
		
		registerTouchArea(mReturnText);

	}

	private void buildScene()
	{
		setBackground(new ColorBackground(1f, 1f, 1f));
	}

}
